
import { request } from '@/utils/request';


import { BaseModel } from '@/api/common/baseModel'

export interface Model extends BaseModel {
  code: string
  remark: string
  createTime?: Date
}

// 查询岗位列表
export const getPage = async (params:  any ) => {
  return await request.get({ url: '/staff/web/userCenter/oa/post/page.json', params })
}

// 获取岗位精简信息列表
export const getList = async (): Promise<Model[]> => {
  return await request.get({ url: '/staff/web/userCenter/oa/post/page.json?pageSize=0' })
}

// 查询岗位详情
export const getById = async (id: string) => {
  return await request.get({ url: '/staff/web/userCenter/oa/post/getById.json?id=' + id })
}

// 修改岗位
export const update = async (data: any) => {
  return await request.put({ url: '/staff/web/userCenter/oa/post/update.json', data })
}

// 删除岗位
export const del = async (id: string) => {
  return await request.delete({ url: '/staff/web/userCenter/oa/post/del.json?id=' + id, data: [id, ],  })
}
